import advListView from '$v/advList';

import {
  isLoginRequest
} from "$a/admin"

export default async (req, res) => {
  // 路由切换的时候权限验证
  try {
    await isLoginRequest()
  } catch (e) {
    alert("有异常" + e.message)

    // 判断是否是权限异常
    if (!e.isLogin) {
      return router.go("/login")
    }
  }

  res.render(advListView())
}